import service from './index'

// code: 0 正常登陆  10008 非法令牌  10012 其他客户端已经登陆

//登录
export const login = data => {
    return service({
        url: '/login',
        method: 'post',
        // params 或 data
        // params: {
        //     username: "admin",
        //     password: "text"
        // }
        params: data
    })
};

//商品
export const goods = data => {
    return service({
        url: '/goods',
        method: 'post',
        params: {}
    })
};

export const searchgoods = data => {
    return service({
        url: '/searchgoods',
        method: 'post',
        params: data
    })
};

export const oneGoods = data => {
    return service({
        url: '/oneGoods',
        method: 'post',
        params: data
    })
};

export const updateGoods = data => {
    return service({
        url: '/updateGoods',
        method: 'post',
        params: data
    })
};

export const deleteGood = data => {
    return service({
        url: '/deleteGood',
        method: 'post',
        params: data
    })
};

//分类
export const classify = data => {
    return service({
        url: '/classify',
        method: 'post',
        params: {}
    })
};

export const getClassify = data => {
    return service({
        url: '/getClassify',
        method: 'post',
        params: data
    })
};